package LifeTest;

public class TitleToNumber {

	public static void main(String[] args) {
		System.out.println(titleToNumber("ZY"));

	}
	 public static int titleToNumber(String columnTitle) {
		 char[] a = columnTitle.toCharArray();
		 int sum = 0;
		 for (int i = 0; i < a.length; i++) {
			 sum *= 26;
			 sum += a[i] - 'A' + 1;
		}
		 return sum;
	 }
}
